# 十字型
ROCK_TEN = [[0, 0, 0, 0],
            [0, 1, 1, 0],
            [0, 1, 1, 0],
            [0, 0, 0, 0]]

# T字型
ROCK_T1 = [[0, 0, 0, 0],
           [1, 1, 1, 0],
           [0, 1, 0, 0],
           [0, 0, 0, 0]]

ROCK_T2 = [[0, 0, 1, 0],
           [0, 1, 1, 0],
           [0, 0, 1, 0],
           [0, 0, 0, 0]]

ROCK_T3 = [[0, 0, 0, 0],
           [0, 1, 0, 0],
           [1, 1, 1, 0],
           [0, 0, 0, 0]]

ROCK_T4 = [[0, 1, 0, 0],
           [0, 1, 1, 0],
           [0, 1, 0, 0],
           [0, 0, 0, 0]]

# L型
ROCK_L1 = [[0, 1, 0, 0],
           [0, 1, 0, 0],
           [0, 1, 1, 0],
           [0, 0, 0, 0]]

ROCK_L2 = [[0, 0, 0, 0],
           [1, 1, 1, 0],
           [1, 0, 0, 0],
           [0, 0, 0, 0]]

ROCK_L3 = [[0, 1, 1, 0],
           [0, 0, 1, 0],
           [0, 0, 1, 0],
           [0, 0, 0, 0]]

ROCK_L4 = [[0, 0, 0, 0],
           [0, 0, 1, 0],
           [1, 1, 1, 0],
           [0, 0, 0, 0]]

# 反L型
ROCK_RL1 = [[0, 0, 1, 0],
            [0, 0, 1, 0],
            [0, 1, 1, 0],
            [0, 0, 0, 0]]

ROCK_RL2 = [[0, 0, 0, 0],
            [1, 0, 0, 0],
            [1, 1, 1, 0],
            [0, 0, 0, 0]]

ROCK_RL3 = [[0, 1, 1, 0],
            [0, 1, 0, 0],
            [0, 1, 0, 0],
            [0, 0, 0, 0]]

ROCK_RL4 = [[0, 0, 0, 0],
            [1, 1, 1, 0],
            [0, 0, 1, 0],
            [0, 0, 0, 0]]

# Z型
ROCK_Z1 = [[0, 0, 0, 0],
           [1, 1, 0, 0],
           [0, 1, 1, 0],
           [0, 0, 0, 0]]

ROCK_Z2 = [[0, 0, 1, 0],
           [0, 1, 1, 0],
           [0, 1, 0, 0],
           [0, 0, 0, 0]]

# 直线型
ROCK_LINE1 = [[0, 0, 0, 0],
              [1, 1, 1, 1],
              [0, 0, 0, 0],
              [0, 0, 0, 0]]

ROCK_LINE2 = [[0, 1, 0, 0],
              [0, 1, 0, 0],
              [0, 1, 0, 0],
              [0, 1, 0, 0]]

# 点型
ROCK_POINT = [[0, 0, 0, 0],
              [0, 1, 0, 0],
              [0, 0, 0, 0],
              [0, 0, 0, 0]]

# 两点型
ROCK_TWOPOINT1 = [[0, 0, 0, 0],
                  [0, 1, 0, 0],
                  [0, 0, 1, 0],
                  [0, 0, 0, 0]]

ROCK_TWOPOINT2 = [[0, 0, 0, 0],
                  [0, 0, 1, 0],
                  [0, 1, 0, 0],
                  [0, 0, 0, 0]]


class Node:
    def __init__(self, val, next = None):
        self.val = val
        self.next = next


Node_Ten = Node(val = ROCK_TEN)
Node_Ten.next = Node_Ten

Node_T = Node(val = ROCK_T1)
Node_T.next = Node(val = ROCK_T2)
Node_T.next.next = Node(val = ROCK_T3)
Node_T.next.next.next = Node(val = ROCK_T4)
Node_T.next.next.next.next = Node_T

Node_L = Node(val = ROCK_L1)
Node_L.next = Node(val = ROCK_L2)
Node_L.next.next = Node(val = ROCK_L3)
Node_L.next.next.next = Node(val = ROCK_L4)
Node_L.next.next.next.next = Node_L

Node_RL = Node(val = ROCK_RL1)
Node_RL.next = Node(val = ROCK_RL2)
Node_RL.next.next = Node(val = ROCK_RL3)
Node_RL.next.next.next = Node(val = ROCK_RL4)
Node_RL.next.next.next.next = Node_RL

Node_Z = Node(val = ROCK_Z1)
Node_Z.next = Node(val = ROCK_Z2)
Node_Z.next.next = Node_Z

Node_Line = Node(val = ROCK_LINE1)
Node_Line.next = Node(val = ROCK_LINE2)
Node_Line.next.next = Node_Line

Node_Point = Node(val = ROCK_POINT)
Node_Point.next = Node_Point

Node_TwoPoint = Node(val = ROCK_TWOPOINT1)
Node_TwoPoint.next = Node(val = ROCK_TWOPOINT2)
Node_TwoPoint.next.next = Node_TwoPoint

# 记录所有方块类型
NODE_KINDS = [Node_Ten, Node_T, Node_L, Node_RL, Node_Z, Node_Line, Node_Point, Node_TwoPoint]
